package com.xxzuibang.day8.方法的重载;

public class Test01 {
    public static void main(String[] args) {
        Method method=new Method();
        System.out.println(method.m(2));
        System.out.println(method.m(2, 3));
        System.out.println(method.m("xx"));

        System.out.println(method.max(10, 20));
        System.out.println(method.max(22.3, 33.4));
        System.out.println(method.max(33.2, 44.3, 23.2));
    }
}
class Method{
    public static  int  m(int a){
        return a*a;
    }
    public static int  m(int a,int b){
        return a*b;
    }
    public static String  m(String a){
        return a;
    }

    public static int max(int a,int b){
        if(a>b){
            return a;
        }else{
            return b;
        }
    }
    public static double max(double a,double b){
        if(a>b){
            return  a;
        }else{
            return  b;
        }
    }
    public static double max(double a,double b,double c) {
        double max;
        if (a > b) {
            max=a;
        }else{
            max=b;
        }
        if(max>c){
            return max;
        }else{
            return c;
        }
    }
}
